<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="refresh" content="1">
    <!-- 自动每秒刷新一次网页 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var time = new Date();
        // console.log(time); //当前终端的时间


        var year = time.getFullYear();
        var month = time.getMonth()+1;
        month = month<10?'0'+month:month;
        var date = time.getDate();
        date = date<10?'0'+date:date;

        var hours = time.getHours();
        hours = hours<10?'0'+hours:hours;
        var minutes = time.getMinutes();
        minutes = minutes<10?'0'+minutes:minutes;
        var seconds = time.getSeconds();
        seconds = seconds<10?'0'+seconds:seconds;

        var week = time.getDay();

        document.write(`${year}年${month}月${date}日 ${hours}时${minutes}分${seconds}秒 周${week}`);

    </script>
</body>
</html>